function [receiver_pos,satellite_pos]=Receiver_Sim(Monitor_Area, ...
    StationDistState, StationInter,StationNum,StationPos)

Monitor_Area_lon_max= max(Monitor_Area(:,1));     %提取监测区域经纬度范围
Monitor_Area_lon_min= min(Monitor_Area(:,1));
Monitor_Area_lat_max= max(Monitor_Area(:,2));
Monitor_Area_lat_min= min(Monitor_Area(:,2));

if StationDistState==1                %格网部署，StationInter有效
    Station_lon=Monitor_Area_lon_min:StationInter:Monitor_Area_lon_max;
    Station_lat=Monitor_Area_lat_min:StationInter:Monitor_Area_lat_max;
    StationNum=length(Station_lon)*length(Station_lat);
    Station_H=rand(StationNum,1);
    [StationPos_Lon,StationPos_Lat] = meshgrid(Station_lon,Station_lat);
    StationPos=[reshape(StationPos_Lon,[],1), reshape(StationPos_Lat,[],1), Station_H];

    in=inpolygon(StationPos_Lon,StationPos_Lat,Monitor_Area(:,1),Monitor_Area(:,2));
    StationPos_in=StationPos(in,:);
    StationNum=sum(sum(in));
    StationPos=StationPos_in;

elseif StationDistState==2            %随机部署，StationNum有效
    StationNum_in = 0;
    StationPos = [];

    while StationNum_in < StationNum
        StationPos_Lon=floor(rand(StationNum - StationNum_in,1) * (Monitor_Area_lon_max - Monitor_Area_lon_min) * 10) / 10 + ones(StationNum - StationNum_in,1)* Monitor_Area_lon_min;
        StationPos_Lat=floor(rand(StationNum - StationNum_in,1) * (Monitor_Area_lat_max - Monitor_Area_lat_min) * 10) / 10 + ones(StationNum - StationNum_in,1)* Monitor_Area_lat_min;
        StationPos_H=floor(rand(StationNum - StationNum_in,1) * 50)/10;
        in=inpolygon(StationPos_Lon,StationPos_Lat,Monitor_Area(:,1),Monitor_Area(:,2));
        StationPos=[StationPos;StationPos_Lon(in), StationPos_Lat(in), StationPos_H(in)];
        StationNum_in=StationNum_in+sum(in);
    end

elseif StationDistState==3            %位置导入，StationPos有效
    StationPos_Lon=StationPos(:,1);
    StationPos_Lat=StationPos(:,2);

    in=inpolygon(StationPos_Lon,StationPos_Lat,Monitor_Area(:,1),Monitor_Area(:,2));
    StationPos_in=StationPos(in,:);
    StationNum=sum(sum(in));
    StationPos=StationPos_in;

end

receiver_pos=StationPos;

%确定卫星的位置
GNSS_tx_num=4;
GNSS_tx_H=2e7;
SatellitePos=zeros(GNSS_tx_num,3);
for i=1:GNSS_tx_num                   %以监测区域经纬度范围随机生成
    SatellitePos(i,1)=rand(1,1)*(Monitor_Area_lon_max-Monitor_Area_lon_min)+Monitor_Area_lon_min;
    SatellitePos(i,2)=rand(1,1)*(Monitor_Area_lat_max-Monitor_Area_lat_min)+Monitor_Area_lat_min;
    SatellitePos(i,3)=GNSS_tx_H;
end

satellite_pos=SatellitePos;

end